import {request} from 'umi'
import {addClassInt,editClassInt} from '@/interface/class'

//获取班级数据
export const getClassManage = ()=>{
    return request('/manger/grade',{method: 'GET'})
}
//获取所有课程
export const getCourseManage = ()=>{
    return request('/exam/subject',{method: 'GET'})
}
//修改班级
export const editClass=(data:editClassInt)=>{
    return request('/manger/grade/update',{method: 'PUT',data})
}

//获取教室数据
export const getRoomManage = ()=>{
    return request('/manger/room',{method: 'GET'})
}

//获取学生数据
export const getStudentManage = ()=>{
    return request('/manger/student',{method: 'GET'})
}
//添加班级
export const addClass =(data:addClassInt)=>{
    return request('/manger/grade',{method: 'POST',data})
}
//删除班级
export const deleteClass = (data:string)=>{
    return request('/manger/grade/delete',{method: 'DELETE', data})
}
//添加教室
export const addRoom =(data:string)=>{
    return request('/manger/room',{method: 'POST',data})
}
//删除教室
export const deleteRoom =(data:string)=>{
    return request('/manger/room/delete',{method: 'DELETE',data})
}

//删除学生
export const deleteStudent=(id:string)=>{
    console.log(id)
    return request(`/manger/student/${id}`,{method: 'DELETE'})
}